package com.eastfair.saga.proxy;

import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * AccountService
 *
 * @author dmego
 * @date 2021/3/31 10:48
 */
//@FeignClient(value = "saga-account-service")
//@RequestMapping("/account")
public interface AccountService {


    /**
     * 扣减余额
     * @param userId
     * @param amount
     * @return
     * @throws Exception
     */
//    @RequestMapping("/reduceBalance")
    Boolean reduceBalance(@RequestParam("userId") Long userId, @RequestParam("amount") Integer amount) throws Exception;

    /**
     * 开始回滚余额
     * @param userId
     * @param amount
     * @return
     * @throws Exception
     */
//    @RequestMapping("/compensateBalance")
    Boolean compensateBalance(@RequestParam("userId") Long userId, @RequestParam("amount") Integer amount) throws Exception;
}
